package com.mercury.tests;

import java.util.List;
import org.hibernate.*;

import com.mercury.beans.*;
public class Test3 {
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Session session = HibernateUtil.currentSession();
		
		Transaction tx = session.beginTransaction();
		session.save(new People("John","Golden",38));
		tx.commit();
		
		String hql ="from People";
		List<People> list = session.createQuery(hql).list();
		for(People p:list){
			System.out.println(p);
			
		}
		HibernateUtil.closeSession();
	}

}
